Adds a copy-to-clipboard button for code blocks in the documentation to improve developer experience.#646
Open
Rishi2600 wants to merge 2 commits intoprobot:masterfrom
Open
Conversation
- Add copy button that appears on hover for all code blocks - Include visual feedback with 'Copied!' confirmation - Support both modern and fallback clipboard APIs - Style with Primer design system conventions - Mobile-friendly with always-visible button on touch devices Fixes probot#645
wolfy1339
requested changes
Nov 21, 2025
_layouts/default.liquid
Outdated
| rel="stylesheet" | ||
| href="/assets/dist/styles.css" | ||
| /> | ||
| <link rel="stylesheet" href="/assets/css/copyIcon.css" /> |
Contributor
There was a problem hiding this comment.
This should be in the _layouts/docs.liquid file
_layouts/default.liquid
Outdated
| </head> | ||
| <body> | ||
| {% include "nav" %} {{ content }} {% include "footer" %} | ||
| <script src="/js/copyIcon.js"></script> |
Contributor
There was a problem hiding this comment.
This should be in the _layouts/docs.liquid file
assets/css/copyIcon.css
Outdated
| color: #57ab5a; | ||
| border-color: #57ab5a; | ||
| } | ||
| } No newline at end of file |
js/copyIcon.js
Outdated
| document.addEventListener("DOMContentLoaded", addCopyButtons); | ||
| } else { | ||
| addCopyButtons(); | ||
| } No newline at end of file |
Author
|
Done with the changes |
Author
|
HEY, Just made the changes. Can you review it and let me know if anything else needs to be done? |
Author
|
Hey, can you take a moment and review it? It would be appreciated! Feedback would be appreciated, if anything else needs to be done. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #645
Changes
Implementation
js/copy-code.jswith copy functionality and button creation logicassets/css/copy-code.csswith styling for the copy button_layouts/default.liquidto include the new CSS and JS filesFor any feature updates or any other details, Contact - github.com/Rishi2600